#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QKeyEvent>
#include <QWidget>
#include "QMediaPlayer"
#include "QMediaPlaylist"
#include <QAudioOutput>



QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    bool Gamestatus; //记录游戏状态
    int mTime;  //记录游戏时间
    QMediaPlaylist *Playlist;
    QMediaPlayer *player;
    QAudioOutput *audioOutput;

private slots:
    void slotUpdateScore(int nScore);
    void slotUpdateLevel(int nSpeed);
    void slotUpdateTime(int tPlayed);
    void on_checkBox_stateChanged(int arg1);
    void on_pbStart_clicked();
    void on_pbPause_clicked();
    void on_pbStop_clicked();

protected:
    void keyPressEvent(QKeyEvent *e);
};
#endif // MAINWINDOW_H
